import { IResult } from '@/interface/common'
import request from '@/units/request'
import { AxiosPromise } from 'axios'
import { IAddCreditQuery, IGetQueueListValidate, IPayAndSignQuery, IQueueItem, IReservationInspectionQuery, ISysPay } from '../interface/inspection'

export const GetQueueList = (data: IGetQueueListValidate) : AxiosPromise<IResult<IQueueItem[]>> =>
  request({
    url: '/api/queue/GetQueueList',
    method: 'post',
    data
  })

export const GetInspectionList = (data: IReservationInspectionQuery) : AxiosPromise<IResult<string>> =>
  request({
    url: '/api/Inspection/Query',
    method: 'post',
    data
  })

export const InspectionPayAndSign = (data: IPayAndSignQuery) : AxiosPromise<IResult<string>> =>
  request({
    url: '/api/Inspection/PayAndSign',
    method: 'post',
    data
  })

export const GetQrCode = (data: IAddCreditQuery) : AxiosPromise<IResult<ISysPay>> =>
  request({
    url: '/api/SysPay/GetQrCode',
    method: 'post',
    data
  })

export const GetPayResult = (id:string) : AxiosPromise<IResult<ISysPay>> =>
  request({
    url: `/api/SysPay/GetPayResult/${id}`,
    method: 'get'
  })
